package com.glasses.business.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.WindowManager;

import com.glasses.business.R;
import com.glasses.business.appliction.MyApplication;
import com.glasses.business.base.BaseActivity;

/**
 * Created by cxh on 2016/9/9.
 */
public class SplashActiviy extends BaseActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        getWindow ().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
//                WindowManager.LayoutParams.FLAG_FULLSCREEN);  //全屏
        setContentView(R.layout.activity_splash);
        MyApplication.getInstance().manager = null;
        if (MyApplication.getInstance().isLogin()) {
            startActivity(new Intent(SplashActiviy.this, MainActivity.class));
            finish();
        } else {
            new Handler().postDelayed(new Runnable() {

                @Override
                public void run() {
                    startActivity(new Intent(SplashActiviy.this, LoginActiviy.class));
                    finish();
                }
            }, 1200);
        }
    }
}
